package cn.classTest.mall.domain;

import com.alibaba.fastjson.JSON;
import lombok.Data;
import cn.classTest.mall.domain.Shop;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

@Component
@Data
public class Goods {
    private Long id;
    private String name;
    private String sn;
    private Boolean status = false;
      private Shop shop;
    private Long num;
    private String json;

    public String getJson() {
        Map<String, Object> map = new HashMap<>();
        map.put("id", id);
        map.put("name", name);
        map.put("sn", sn);
        map.put("status", status);
        map.put("shop", shop);
        map.put("num", num);
        return JSON.toJSONString(map);
    }
}
